feat: use task summaries endpoint for sidebar loads#1945
Open
jonathanlab wants to merge 4 commits intomainfrom
Open
feat: use task summaries endpoint for sidebar loads#1945jonathanlab wants to merge 4 commits intomainfrom
jonathanlab wants to merge 4 commits intomainfrom
Conversation
Generated-By: PostHog Code Task-Id: a801cf87-213b-451b-9cdc-5150e50bc059
Contributor
Prompt To Fix All With AIThis is a comment left during a code review.
Path: apps/code/src/renderer/features/sidebar/hooks/useSidebarData.ts
Line: 144-148
Comment:
**`useTasks` polled unconditionally on the optimized path**
When `showAllUsers` is `false`, `useTaskSummaries` is used for sidebar data and `fullTasks` is explicitly discarded (`rawTasks = summaryTasks`). Yet `useTasks` is called without an `enabled` guard, so the heavy `/tasks/` list endpoint is still polled at `TASK_LIST_POLL_INTERVAL_MS` in the background on every sidebar mount — directly undercutting the optimisation this PR introduces. Adding `enabled: showAllUsers` (or an equivalent guard) to the hook options would restrict the full-list poll to only the code path that needs it.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "feat: use task summaries endpoint for si..." | Re-trigger Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See PostHog/posthog#56959